package com.devunion.salon.web.form;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

import javax.servlet.http.HttpServletRequest;

/**
 * @author Viktar Liaskovich
 */
public class DayForm extends ActionForm {
    private String hiddenDate;
    private Float startCashMorning;
    private String submittedValue;

    private Float totalAmex;
    private Float totalMastercard;
    private Float totalVisa;
    private Float totalCheck;
    private Float cashIn;
    private Float cashOut;
    private Float totalCach;
    private Float startDayCach = 0f;
    private Float dailyTotal=0F;

    private Float adjustment;
    private Float putInEnvelop;

    public void reset() {
        totalAmex = totalCheck = totalVisa = totalMastercard = cashIn = cashOut = totalCach = startDayCach = dailyTotal = 0f;
    }

    public void reset(ActionMapping actionMapping, HttpServletRequest httpServletRequest) {
        submittedValue = null;
        startCashMorning = null;
        super.reset(actionMapping, httpServletRequest);
    }

    public Float getStartCashMorning() {
        return startCashMorning;
    }

    public void setStartCashMorning(Float startCashMorning) {
        this.startCashMorning = startCashMorning;
    }

    public String getSubmittedValue() {
        return submittedValue;
    }

    public void setSubmittedValue(String submittedValue) {
        this.submittedValue = submittedValue;
    }

    public String getHiddenDate() {
        return hiddenDate;
    }

    public void setHiddenDate(String hiddenDate) {
        this.hiddenDate = hiddenDate;
    }

    public void addTotalAmex(Float totalAmex) {
        this.totalAmex += totalAmex;
    }

    public void addTotalMastercard(Float totalMastercard) {
        this.totalMastercard += totalMastercard;
    }

    public void addTotalVisa(Float totalVisa) {
        this.totalVisa += totalVisa;
    }

    public void addTotalCheck(Float totalCheck) {
        this.totalCheck += totalCheck;
    }

    public void addCashIn(Float cashIn) {
        this.cashIn += cashIn;
    }

    public void addCashOut(Float cashOut) {
        this.cashOut += cashOut;
    }

    public Float getTotalAmex() {
        return totalAmex;
    }

    public Float getTotalMastercard() {
        return totalMastercard;
    }

    public Float getTotalVisa() {
        return totalVisa;
    }

    public Float getTotalCard() {
        return totalAmex + totalMastercard + totalVisa;
    }

    public Float getTotalCheck() {
        return totalCheck;
    }

    public Float getCashIn() {
        return cashIn;
    }

    public Float getCashOut() {
        return cashOut;
    }

    public Float getStartDayCach() {
        return startDayCach;
    }

    public void setStartDayCach(Float startDayCach) {
        this.startDayCach = startDayCach;
    }

    public Float getTotalCachWithoutStart() {
        return totalCach + cashIn - cashOut;
    }

    public Float getTotalCachWithStart() {
        return totalCach + cashIn - cashOut + startDayCach;
    }

    public Float getTotalCach() {
        return totalCach;
    }

    public void addTotalCach(Float totalCach) {
        this.totalCach = totalCach;
    }

    public Float getTotalEndOfTheDay() {
        return getTotalCachWithStart() + dailyTotal;
    }

    public Float getAdjustment() {
        return adjustment;
    }

    public void setAdjustment(Float adjustment) {
        this.adjustment = adjustment;
    }

    public Float getPutInEnvelop() {
        return putInEnvelop;
    }

    public void setPutInEnvelop(Float putInEnvelop) {
        this.putInEnvelop = putInEnvelop;
    }

    public void addDailyTotal(Float number) {
        this.dailyTotal += number;
    }

    public Float getDailyTotal() {
        return dailyTotal;
    }

    public void setDailyTotal(Float dailyTotal) {
        this.dailyTotal = dailyTotal;
    }
}
